<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
	<s:if test="type==1">
		<title>个人贷款审批</title>
		<span id="navlink">贷款审批 >> 个人贷款审批</span>
	</s:if>
	<s:elseif test="type==2">
		<title>企业贷款审批</title>
		<span id="navlink">贷款审批 >> 企业贷款审批</span>
	</s:elseif>
		<s:form action="creditApprovalAction" method="post">
			<s:hidden name="type" value="%{#request.type}" />
		<s:div id="left_area">
				<%-- <s:submit value="等待审批" method="cdw"/>
				<s:submit value="完成审批" method="cdd"/>
				<s:submit value="审批未通过" method="cdb"/>
				<s:submit value="上级返回" method="cdr"/> --%>
				<input type="radio" name="searchwhat" id="searchwhatw" <s:if test="searchwhat==1">checked="checked"</s:if>/><label for="searchwhatw">等待</label>
				<input type="radio" name="searchwhat" id="searchwhatd" <s:if test="searchwhat==2">checked="checked"</s:if>/><label for="searchwhatd">完成</label>
				<input type="radio" name="searchwhat" id="searchwhatb" <s:if test="searchwhat==3">checked="checked"</s:if>/><label for="searchwhatb">未通过</label>
				<input type="radio" name="searchwhat" id="searchwhatr" <s:if test="searchwhat==4">checked="checked"</s:if>/><label for="searchwhatr">上级返回</label>
		</s:div>
		</s:form>
		<br/>
<br/>
<!-- <div id="top_area">
	<input type="button" id="search" value="查找" />
</div> -->
<table class="table_box table_bottom_border">
	<tr>
		<th><b>申请单编号</b>
		</th>
		<th><b>客户名称</b>
		</th>
		<th><b>申请金额</b>
		</th>
		<th><b>申请日期</b>
		</th>
		<th><b>借款日期</b>
		</th>
		<th><b>状态</b>
		</th>
		<th><b>编辑/查看</b>
		</th>
	</tr>
	<s:iterator value="creditApprovalBeanList" status="index" var="var">
		<tr>
			<td align="center"><s:if test="#request.type==1">RFG</s:if><s:elseif test="#request.type==2">RFQ</s:elseif>${applyid }</td>
			<td align="center">${customName }</td>
			<td align="right"><s:text name="f.money">
					<s:param value="applyMoney" />
				</s:text>
			</td>
			<td align="center"><s:text name="f.date.ymd">
					<s:param name="value" value="applyDate" />
				</s:text>
			</td>
			<td align="center"><s:text name="%{applyTime}"/><s:text name="%{applyTimeType}"/>
				</td>
			<td align="center">
						<span>${applyStateStr}</span></td>
			<td align="center"><s:form action="creditApprovalAction"
					method="post" style="margin:0px;display:inline;">
					<s:hidden name="type" value="%{#request.type}" />
					<s:hidden name="isCanChange" value="%{isCanChange}" />
					<input type="hidden" name="applyid" value="${applyid }" />
							<s:submit value="%{buttonStateStr}" method="applyApproval" />
				</s:form></td>
	</s:iterator>
</table>
<div id="button_area"><div class="pagebar"></div></div>
<script type="text/javascript">
<!--
	$("#search").click(function() {
		$("#dialog-search").dialog({
			resizable : false,
			modal : true
		});
	});
	
	$(function() {
		$.datepicker.setDefaults($.datepicker.regional['zh-CN']);
		$('#createtime').datetimepicker({
			dateFormat : "yy-mm-dd",
			showTimepicker : false,
			changeMonth : true,
			changeYear : true
		});
	});
	$("#searchwhatw").click(function(){
		location.href="creditApprovalAction!cdw?type=${type}";
	});
	$("#searchwhatd").click(function(){
		location.href="creditApprovalAction!cdd?type=${type}";
	});
	$("#searchwhatb").click(function(){
		location.href="creditApprovalAction!cdb?type=${type}";
	});
	$("#searchwhatr").click(function(){
		location.href="creditApprovalAction!cdr?type=${type}";
	});
//-->
</script>

<s:div id="dialog-search" style="display:none" title="查询">
	<s:form action="creditApprovalAction!searchList" method="get">
		<s:hidden name="operateState" value="%{#request.operateState}" />
		<s:hidden name="type" value="%{#request.type}" />
			申请单编号：<s:textfield name="searchApplyid"></s:textfield>
		<s:div style="float:right">
			<s:submit value="查询" />
		</s:div>
	</s:form>
</s:div>